package com.component.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.component.domain.MJob;
import com.component.service.MJobService;
import com.component.mapper.MJobMapper;
import org.springframework.stereotype.Service;

/**
 *
 */
@Service
public class MJobServiceImpl extends ServiceImpl<MJobMapper, MJob>
    implements MJobService{

    @Override
    public IPage<MJob> page(Integer pageNum, Integer pageSize) {
        LambdaQueryWrapper<MJob> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        IPage<MJob> mJobIPage=this.baseMapper.selectPage(new Page(pageNum,pageSize),lambdaQueryWrapper);
        return mJobIPage;
    }

    @Override
    public MJob getMJobByMethodCLazz(String clazz) {
        LambdaQueryWrapper<MJob> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(MJob::getMethodclazz,clazz);
        MJob mJob=this.baseMapper.selectOne(lambdaQueryWrapper);
        return mJob;
    }
}




